//===============================================================================
// Microsoft patterns & practices
// Web Client Software Factory
//-------------------------------------------------------------------------------
// Copyright (C) Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//-------------------------------------------------------------------------------
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================
using System;
using System.Collections.Generic;
using System.Text;

namespace WCSFContrib.PageFlow.WorkflowFoundation.Tests.Mocks
{
    public class MockConfigurablePageFlowDefinition : IPageFlowDefinition
    {
        private AbandonBehavior _abandonable;

        public AbandonBehavior Abandonable
        {
            get
            {
                return _abandonable;
            }
            set
            {
                _abandonable = value;
            }
        }
        
        public Page AbortPage
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        private bool _constrained;
        public bool Constrained
        {
            get { return _constrained; }
            set { _constrained = value; }
        }

        public string Name
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }
        
        public string NotRunningRedirect
        {
            get { return "~/NotRunning.aspx"; }
        }

        private Dictionary<string, Page> _pages = new Dictionary<string, Page>();
        public void AddPage(Page page)
        {
            _pages.Add(page.Url, page);
        }

        public System.Collections.ObjectModel.ReadOnlyCollection<Page> Pages
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public Page StartPage
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        private Type _pageFlowType;

        public Type PageFlowType
        {
            get { return _pageFlowType; }
            set { _pageFlowType = value; }
        }

        public bool ContainsPage(Page page)
        {
            return _pages.ContainsValue(page);
        }

        public bool ContainsUrl(string url)
        {
           return _pages.ContainsKey(url);
        }

        public Page GetPage(string stateName)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public Page GetPageFromUrl(string url)
        {
            return _pages[url];
        }
    }
}
